package com.pig.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pig.pojo.addr.Addr;
import com.pig.pojo.order.Order;
import com.pig.pojo.order.OrderItem;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    @Select("SELECT * from p_addr where userId = #{userId}")
    List<Addr> findAddrByUserId(Integer userId);

    @Insert("INSERT into p_addr (addrId,userId,receiverName,receiverPhone,receiverProvince,receiverCity,receiverRegion,receiverAddress,createdTime,modifiedTime)" +
            " values (#{addrId},#{userId},#{receiverName},#{receiverPhone},#{receiverProvince},#{receiverCity},#{receiverRegion},#{receiverAddress},#{createdTime},#{modifiedTime})")
    void insertAddr(Addr addr);
}
